/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.B030;
import queenb.net.entitybean.C650;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class C650Store extends C650 {
    
    public List<C650> COMBTABC650(int pnFH000, int pnFH200, String pvFC150, int pnFN100, String pvLOGIN){
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.COMBOBOX_C650R, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvFC150),
                        new Param(OracleTypes.INTEGER, pnFN100),                        
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, C650.class);
        } catch (SQLException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public List<C650> LISTOFTABC650R(int pnFH000, String pvFC150, int pnFN100, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_C650R, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.CHAR, pvFC150),
                        new Param(OracleTypes.INTEGER, pnFN100),                        
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, C650.class);
        } catch (SQLException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public List<C650> LISTOFTABC650L(int pnFH000, String pvFC150, int pnFN100, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.LIST_C650L, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.CHAR, pvFC150),
                        new Param(OracleTypes.INTEGER, pnFN100),                        
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, C650.class);
        } catch (SQLException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    public int StornoTabC650(int pnFH000, int pnFH200, int pnFN100, String pvFC150, String pvLOGIN){
    try {
            DataStatement dataStatement = new DataStatement(PackageContants.DELETE_C650, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),                        
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvFC150),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return update(dataStatement, C650.class);
        } catch (SQLException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    
    }
    public int INSERTTABC650(int pnFH000, int pnFH200, int pnFB050, int pnFN100, String pvFC150, int pnFC500,
            Date pdCD651, int pnCN652, int pnCN653, String pvLOGIN){
    try {
            DataStatement dataStatement = new DataStatement(PackageContants.INSERT_C650, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),                        
                        new Param(OracleTypes.INTEGER, pnFB050),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvFC150),                        
                        new Param(OracleTypes.INTEGER, pnFC500),
                        new Param(OracleTypes.DATE, pdCD651),
                        new Param(OracleTypes.INTEGER, pnCN652),
                        new Param(OracleTypes.INTEGER, pnCN653),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return update(dataStatement, C650.class);
        } catch (SQLException ex) {
            Logger.getLogger(C650Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
